//
//  DeviceStateView.m
//  sensen_ios
//
//  Created by mc on 16/4/9.
//  Copyright © 2016年 pro. All rights reserved.
//

#import "DeviceStateView.h"










@implementation DeviceStateView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.cornerRadius = 20;
        
        self.backgroundColor = rgba(238, 239, 240, 1);
        //标题
        UILabel *  headLabel = [[UILabel alloc] init];
        headLabel.font = FONT(15);
        headLabel.textColor = [UIColor blackColor];
        [self  addSubview:headLabel];
        [headLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.mas_centerX);
            make.top.equalTo(self).offset(10);
            make.size.mas_equalTo(CGSizeMake(80, 20));
        }];
        headLabel.backgroundColor = rgba(238, 239, 240, 1);
        headLabel.text = @"状态信息";
        
        
        self.stateLable = [[UITextView alloc] init];
        self.stateLable.textColor = [UIColor blackColor];
        [self  addSubview:self.stateLable];
        [self.stateLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(headLabel.mas_bottom).offset(18);
            make.bottom.equalTo(self).offset(-5);
            make.left.equalTo(self).offset(10);
            make.right.equalTo(self).offset(-10);
        }];
        
        self.stateLable.font = [UIFont systemFontOfSize:12];
        self.stateLable.editable = NO;
        self.stateLable.backgroundColor =  rgba(238, 239, 240, 1);
        
        
        self.versionLable = [[UILabel alloc] init];
        self.versionLable.textColor = [UIColor blackColor];
        [self  addSubview:self.versionLable];
        [self.versionLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(headLabel.mas_bottom).offset(5);
            make.bottom.equalTo(self.stateLable.mas_top).offset(0);
            make.left.equalTo(self).offset(10);
            make.right.equalTo(self).offset(0);
        }];
        
        self.versionLable.font = [UIFont systemFontOfSize:12];
        self.versionLable.numberOfLines = 1;
        
    }
    return self;
}

- (void)setStateText:(NSString *)stateText{
    self.stateLable.text = stateText;
}

- (void)setVersionText:(NSString *)versionText{
    self.versionLable.text = versionText;
}


@end
